package main

import (
	"os"

	"github.com/seosite/gcore/pkg/rest"
	"go-template/internal/router"
)

func main() {

	opt := rest.ServerOpt{
		ConfigFile:    initConfig(),
		Router:        router.APIRouter,
		MigrateTables: initTables(),
	}

	server := rest.Default(opt)

	server.Run()
}

func initConfig() string {
	env := os.Args[1]
	return "./configs/" + env + ".yaml"
}

func initTables() map[string][]interface{} {
	dbMigrate := make(map[string][]interface{})
	dbMigrate["default"] = []interface{}{
		// your db model
	}

	return dbMigrate
}
